/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-5-4 下午12:24 Created by dwzhang
 */
package com.jade.bss.business.order;

import java.util.Date;
import javax.persistence.*;

import com.jade.journal.JournalEntity;

/**
 * 订单跟踪记录。
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-5-4 下午12:24
 */
@Entity
@Table (name = "BSS_ORDER_TRACE_RECORD")
public class TraceRecord
        extends JournalEntity
{
    public static final String NAME = "journal_order_trace_record";
    //创建
    public static final String OP_CREATE = "create";
    //更新
    public static final String OP_UPDATE = "update";
    //取消
    public static final String OP_CANCEL = "cancel";
    //支付
    public static final String OP_PAY = "paid";
    //完成
    public static final String OP_FINISH = "finish";
    //删除
    public static final String OP_REMOVE = "remove";

    @Id
    @GeneratedValue (generator = "SEQ_BSS_ORDER_TRACE_RECORD")
    @SequenceGenerator (name = "SEQ_BSS_ORDER_TRACE_RECORD", sequenceName = "SEQ_BSS_ORDER_TRACE_RECORD")
    private long id;
    @Column (name = "order_id", nullable = false, updatable = false)
    private long orderId;
    @Column (name = "operator_type", length = 32, updatable = false)
    private String operatorType;
    @Column (name = "operator", length = 32, updatable = false)
    private String operator;
    @Column (name = "operation", length = 32, nullable = false, updatable = false)
    private String operation;
    @Column (name = "remark", length = 256, updatable = false)
    private String remark;
    @Column (name = "op_date", nullable = false, updatable = false)
    private Date opDate;
    //操作结果
    @Column (name = "execute_result")
    private boolean result = true;
    //错误代码
    @Column (name = "execute_code", length = 64)
    private String errorCode;
    //错误描述
    @Column (name = "execute_remark", length = 255)
    private String errorMessage;

    public TraceRecord()
    {
        super(NAME);
    }

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public long getOrderId()
    {
        return orderId;
    }

    public void setOrderId(long orderId)
    {
        this.orderId = orderId;
    }

    public String getOperatorType()
    {
        return operatorType;
    }

    public void setOperatorType(String operatorType)
    {
        this.operatorType = operatorType;
    }

    public String getOperator()
    {
        return operator;
    }

    public void setOperator(String operator)
    {
        this.operator = operator;
    }

    public String getOperation()
    {
        return operation;
    }

    public void setOperation(String operation)
    {
        this.operation = operation;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public Date getOpDate()
    {
        return opDate;
    }

    public void setOpDate(Date opDate)
    {
        this.opDate = opDate;
    }

    public boolean isResult()
    {
        return result;
    }

    public void setResult(boolean result)
    {
        this.result = result;
    }

    public String getErrorCode()
    {
        return errorCode;
    }

    public void setErrorCode(String errorCode)
    {
        this.errorCode = errorCode;
    }

    public String getErrorMessage()
    {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage)
    {
        this.errorMessage = errorMessage;
    }
}
